<template>
	<Layout>
		<div>
			<h1>Post1</h1>
			<ul>
				<li v-for="post in posts" :key="post.id">
					<g-link :to="`/post-detail/${post.id}`">{{ post.title }}</g-link>
				</li>
			</ul>
		</div>
	</Layout>
</template>
<script>
import axios from 'axios';
export default {
	name: 'Post1',
	data() {
		return {
			posts: [],
		};
	},
	async mounted() {
		const { data } = await axios.get(
			'http://jsonplaceholder.typicode.com/posts'
		);
		this.posts = data;
		console.log(data, 'data');
	},
};
</script>
